from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get('https://www.baidu.com')
driver.maximize_window()


#基础选择器
# ID选择器
print(driver.find_element(By.CSS_SELECTOR, '#kw').get_attribute('outerHTML'))
#class选择器
print(driver.find_element(By.CSS_SELECTOR, '.s_ipt').get_attribute('outerHTML'))
print(driver.find_element(By.CSS_SELECTOR, "input[name = 'wd']").get_attribute('outerHTML'))

driver.quit()


